home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / cool.lha / ice / cpp / tests / classmac.i < prev    next >
Encoding:
Text File  |  1991-09-04  |  1.4 KB  |  65 lines

  1.  
  2. #line 1 "chuck.C"
  3. //
  4. // Copyright (C) 1991 Texas Instruments Incorporated.
  5. //
  6. // Permission is granted to any individual or institution to use, copy, modify,
  7. // and distribute this software, provided that this complete copyright and
  8. // permission notice is maintained, intact, in all copies and supporting
  9. // documentation.
  10. //
  11. // Texas Instruments Incorporated provides this software "as is" without
  12. // express or implied warranty.
  13. //
  14. // test file for the class, MACRO, and Template defmacros
  15. //
  16.  
  17.  
  18.  
  19.  
  20. // tell the class macro to call the generate_slot_accessors macro inside
  21. // the class definition.  There will be a call to the slot_accessor macro
  22. // in the body arg to generate_slot_accessors for each slot in the class.
  23.  
  24.  
  25.  
  26. // Invoked from the class macro
  27.  
  28.  
  29. // expanded within my_generate_methods
  30.  
  31.  
  32. class foo :virtual public Generic{
  33.  private:
  34.   int* data;                // Pointer to allocated storage
  35.   char *a, *b, c;            // Three miscellaneous variables
  36.   int size;                // Size of foo object
  37.   void grow (int new_size);        // Private function to grow foo
  38.  public:
  39.   foo (int);                // Constructor with size
  40.   ~foo (){};                // Destructor 
  41.   int& operator[] (int);        // Operator[] overload for Type
  42.   Boolean find (const int&);        // Find element in foo
  43.   // ..
  44.  
  45.  
  46.  
  47.  
  48.   const int*& get_data() { return data }
  49.  
  50.  
  51.   const char*& get_a() { return a }
  52.  
  53.  
  54.   const char*& get_b() { return b }
  55.  
  56.  
  57.   const char*& get_c() { return c }
  58.  
  59.  
  60.   const int& get_size() { return size }
  61.  
  62.  
  63. };
  64.  
  65.